import ch from "../lang/ch.json"
import en from "../lang/en.json"
import {useState} from "react"

type LanguageType = "ch"|"en"

const translation : Record<LanguageType,TranslationKey> = {ch,en}
export const useLanguage=()=>{
    const [language,setLanguage] = useState<LanguageType>("ch");

    const t=()=>{
        return translation[language]
    }

    return {language,setLanguage,t};
}